<?php
/**
 * Created by Zhy
 * User: Zhy
 * Date: 2018/12/17
 * Time: 16:10
 */

namespace app\api\model;


use think\Model;

class UUser extends Model
{
    /**
     * 获取用户的基本信息
     * @param $user_id  用户ID
     * @param $field  查询字段
     * @return array|false|\PDOStatement|string|Model
     */
    public function getUserInfo($user_id, $field){
        $userInfo = $this
            ->field($field)
            ->where('user_id', $user_id)
            ->find();
        return $userInfo;
    }
    
    /**
     * 编辑
     * @param $user_id  修改条件
     * @param $data  修改数据
     * @return $this
     */
    public function editData($user_id, $data){
        $res = $this->where('user_id', $user_id)->update($data);
        return $res;
    }
}